package org.example.emp.controller;

import org.example.emp.pojo.Admin;
import org.example.emp.pojo.Result;
import org.example.emp.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("login")
public class AdminController {

    @Autowired
    private AdminService adminService;

    @PostMapping
    public Result login(@RequestBody Admin admin){
        return adminService.login(admin);
    }

    @GetMapping
    public Result getInfo(String token) throws Exception {
        return adminService.getInfo(token);
    }

}
